package router

import (
	"getaway/basic/config"
	"getaway/handler/api"
	"getaway/middleware"
	"github.com/gin-gonic/gin"
)

func Order(v1 *gin.RouterGroup) {
	orders := v1.Group("/order")
	{
		orders.POST("/OrderPaymentCallback", api.OrderPaymentCallback) // 订单支付回调
		orders.Use(middleware.JWTAuth(config.KEY_JWT))
		orders.POST("/createOrder", api.CreateOrder)                                     // 创建订单
		orders.POST("/cancelOrder", api.CancelOrder)                                     // 取消订单
		orders.GET("/cancelOrderList", api.GetCancelOrderList)                           //已取消订单列表
		orders.POST("/OrderCancellationUpdateStatus", api.OrderCancellationUpdateStatus) // 修改取消订单状态
		orders.GET("/trajectoryList", api.GetTrajectoryList)                             // 订单行动轨迹
		orders.POST("/recordLocation", api.RecordLocation)                               // 记录轨迹经纬度
		orders.POST("/receiveLocationInfo", api.ReceiveLocationInfo)                     // 接收位置经纬度放入队列
		orders.POST("/updateOrderStatus", api.UpdateOrderStatus)                         // 修改订单状态
		orders.POST("/pricingInformationAdd", api.PricingInformationAdd)                 // 订单价格信息添加
		orders.GET("/pricingInformationDetail", api.PricingInformationDetail)            // 订单价格信息详情
		orders.GET("/orderDetail", api.OrderDetail)                                      //订单信息详情
		orders.GET("/orderTimeDetail", api.OrderTimeDetail)                              //订单时间详情
		orders.POST("/doubtAdd", api.DoubtAdd)                                           //订单疑义添加
		orders.POST("/doubtDel", api.DoubtDel)                                           //订单疑义删除
		orders.POST("/doubtUpdate", api.DoubtUpdate)                                     //订单疑义修改
		orders.GET("/doubtList", api.DoubtList)                                          //订单疑义展示
		orders.GET("/doubtDetail", api.DoubtDetail)                                      //订单疑义详情
		orders.POST("/orderComment", api.OrderComment)                                   //订单评论
		orders.POST("/orderCancellationDel", api.OrderCancellationDel)                   //订单取消删除
		orders.GET("/orderCancellationDetail", api.OrderCancellationDetail)              //订单取消详情
		orders.GET("/cancelOrderStatusList", api.CancelOrderStatusList)                  // 取消订单列表状态
		orders.POST("/couponCreate", api.CouponCreate)                                   //优惠券创建
		orders.POST("/reassignCreate", api.ReassignCreate)                               //改派创建
		orders.POST("/orderDriverId", api.OrderDriverId)                                 //司机接单
		orders.POST("/doubtUpdateStatus", api.DoubtUpdateStatus)                         //订单疑义修改状态
		orders.POST("/couponTemplateAdd", api.CouponTemplateAdd)                         //优惠券模板创建
		orders.POST("/updateReassignStatus", api.UpdateReassignStatus)                   //修改改派状态
		orders.GET("/getUserIdOrderInfo", api.GetUserIdOrderInfo)                        //用户查看订单列表
		orders.POST("/userCouponAdd", api.UserCouponAdd)                                 //用户添加优惠券
		orders.POST("/userCollectAdd", api.UserCollectAdd)                               //用户收藏优惠券
		orders.POST("/userShareCouponsAdd", api.UserShareCouponsAdd)                     //用户分享优惠券添加
		orders.GET("/couponTemplateList", api.CouponTemplateList)                        //优惠券模板列表
		orders.GET("/couponTemplateSearch", api.CouponTemplateSearch)                    //优惠券模板搜索
		orders.POST("/couponSharesAdd", api.CouponSharesAdd)                             //优惠券分享添加
	}
	//行程规则
	{
		orders.POST("/rating", api.Rating)                                   //统一评价（同时支持司机评价乘客和乘客评价司机）
		orders.GET("/getRatingsByTargetId", api.GetRatingsByTargetId)        //获取用户收到的评价列表
		orders.POST("/getAverageRating", api.GetAverageRating)               //获取用户平均评分
		orders.GET("/getRatingByOrder", api.GetRatingByOrder)                //获取指定订单的评价
		orders.POST("/emergencyHelp", api.EmergencyHelp)                     //紧急求助
		orders.POST("/shareTrip", api.ShareTrip)                             //行程分享
		orders.POST("/getInsuranceInfo", api.GetInsuranceInfo)               //获取保险信息
		orders.GET("/getUserScheduledOrders", api.GetUserScheduledOrders)    //获取用户预约订单列表
		orders.POST("/cancelScheduledOrder", api.CancelScheduledOrder)       //取消预约订单
		orders.POST("/exportOrder", api.ExportOrder)                         //导出订单
		orders.POST("/downloadExportFile", api.DownloadExportFile)           //下载导出文件路由
		orders.GET("/getExportTaskListOrder", api.GetExportTaskListOrder)    //获取导出任务列表
		orders.POST("/deleteExportTaskOrder", api.DeleteExportTaskOrder)     //删除导出任务
		orders.POST("/downloadExportFileOrder", api.DownloadExportFileOrder) //下载导出文件
		orders.POST("/getExportProgressOrder", api.GetExportProgressOrder)   //获取导出进度
	}
}
